<template>
  <div>
    
    
    <ul class="mui-table-view">
				<li class="mui-table-view-cell mui-media" v-for="item in newList" :key="item.id">
					<router-link :to="'/home/newsInfo/' + item.id">
						<img class="mui-media-object mui-pull-left" :src="item.imgUrl">
						<div class="mui-media-body">
						  <h3>{{ item.title }}</h3> 
							<p class='mui-ellipsis'>
                <span>{{ item.addTime | dateFormat() }}</span>
                <span>浏览：{{ item.clickNum }}次</span>
              </p>
						</div>
					</router-link>
				</li>
			</ul>


  </div>
</template>

<script>

import { Toast } from 'mint-ui';
export default {
  data() {
    return {
      newList: []
    }
  },
  created() {
    this.getNewList();
  },
  methods: {
    getNewList() {
      this.$http.get('./../../../api/newlist.json').then(res => {
        if(res.body.status === 0) {
          this.newList = res.body.message;
        }else {
          Toast('获取列表失败!')
        }
      })
    }
  }
}
</script>

<style scoped>
  .mui-table-view h3{
    font-size: 14px;
  }

  .mui-ellipsis {
    font-size: 12px;
    color: #229787;
    display: flex;
    justify-content:space-between;
  }
</style>
